package service;

import Dao.GoodsDao;
import Dao.GoodsDaoImpl;
import Dao.UserDao;
import Dao.UserDaoImpl;
import entity.Goods;
import util.DatabaseUtil;

import java.sql.Connection;
import java.util.List;

public class GoodsServiceImpl implements GoodsService {
    Connection conn = DatabaseUtil.getConnection();
    GoodsDao goodsDao = new GoodsDaoImpl(conn);

    @Override
    public Goods getCommod() {
        return goodsDao.getCommod();
    }

    @Override
    public List<Goods> getCommodity(String name) {
        return goodsDao.getCommodity(name);
    }

    @Override
    public List<Goods> getProduct(String name) {
        return goodsDao.getProduct(name);
    }

    @Override
    public Goods getParticulars(int id) {
        return goodsDao.getParticulars(id);
    }

    @Override
    public List<Goods> getSeries(int id) {
        return goodsDao.getSeries(id);
    }
}
